// See https://sequelize.org/master/manual/model-basics.html
// for more of what you can do here.
const Sequelize = require('sequelize');
const DataTypes = Sequelize.DataTypes;
module.exports = function (app) {
  const sequelizeClient = app.get('sequelizeClient');
  const contentWz = sequelizeClient.define('content_wz', {
    photo: DataTypes.STRING, // 图片
    title: DataTypes.STRING, // 类型是字符串
    clicknum: DataTypes.STRING, // 类型是字符串
    state: DataTypes.STRING, //数据状态为整数类型
    creator: DataTypes.STRING, // 创建者
  }, {
    hooks: {
      beforeCount(options) {
        options.raw = true;
      }
    }
  });

  // eslint-disable-next-line no-unused-vars
  contentWz.associate = function (models) {
    // Define associations here
    // See https://sequelize.org/master/manual/assocs.html
  };

  return contentWz;
};
